<?php

namespace App\Providers;

use App\Http\Controllers\Content\System\Tag;
use App\Models\EduTopic;
use App\Observers\EduTopicObserver;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //加载自定义标签的方法,这样laravel框架就会自动加载我们指定的创建自定义标签的方法
        (new Tag())->make();
        //在这里注册一个模型观察器
        EduTopic::observe(EduTopicObserver::class);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
        if ($this->app->environment() !== 'production') {
            $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
        }
    }
}
